Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
bpmn-moddle
Advanced tools
Read and write BPMN 2.0 diagram files in NodeJS and the browser.
bpmn-moddle uses the BPMN 2.0 meta-model to validate the input and produce correct BPMN 2.0 XML. The library is built on top of moddle and moddle-xml.
Get the library via npm package. Bundle it for the web using browserify or webpack.
var BpmnModdle = require('bpmn-moddle');
var moddle = new BpmnModdle();
var xmlStr =
'<?xml version="1.0" encoding="UTF-8"?>' +
'<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" id="empty-definitions" targetNamespace="http://bpmn.io/schema/bpmn">' +
'</bpmn2:definitions>';
moddle.fromXML(xmlStr, function(err, definitions) {
// update id attribute
definitions.set('id', 'NEW ID');
// add a root element
var bpmnProcess = moddle.create('bpmn:Process', { id: 'MyProcess_1' });
definitions.get('rootElements').push(bpmnProcess);
moddle.toXML(definitions, function(err, xmlStrUpdated) {
// xmlStrUpdated contains new id and the added process
});
});
You need grunt to build the project.
To run the test suite that includes XSD schema validation you must have a Java JDK installed and properly exposed through the JAVA_HOME
variable.
Execute the test via
grunt test
Perform a complete build of the application via
grunt
Use under the terms of the MIT license.
FAQs
A moddle wrapper for BPMN 2.0
We found that bpmn-moddle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.